import axios from './axios'
import {welUrl} from '@/config/config'
// 公益统计 /agent-center/public/welfare/income/list
export const getList = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/public/welfare/income/list',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 获取个人信息 /agent-center/public/welfare/info/get
export const getPerson = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/public/welfare/info/get',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 修改个人信息 /agent-center/public/welfare/info/update
export const updatePerson = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/public/welfare/info/update',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 提现
export const getCash = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/agent/withdrawalOperation',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        }).catch(
            res => {
                reject(res.data)
            }
        )
    })
}
// 获取提现记录
export const getCashRecord = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/agent/pageWithdrawalRecord',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        }).catch(
            res => {
                reject(res.data)
            }
        )
    })
}
// 获取银行列表  /agent-center/settleRecord/listBank
export const getBankList = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: welUrl + '/agent-center/settleRecord/listBank',
            method: 'post',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}